3.1.90 \(\int \frac {\cos (a+b \log (c x^n))}{x^2} \, dx\) [90]

Optimal. Leaf size=56 \[ -\frac {\cos \left (a+b \log \left (c x^n\right )\right )}{\left (1+b^2 n^2\right ) x}+\frac {b n \sin \left (a+b \log \left (c x^n\right )\right )}{\left (1+b^2 n^2\right ) x} \]

[Out]

-cos(a+b*ln(c*x^n))/(b^2*n^2+1)/x+b*n*sin(a+b*ln(c*x^n))/(b^2*n^2+1)/x

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {4574} \begin {gather*} \frac {b n \sin \left (a+b \log \left (c x^n\right )\right )}{x \left (b^2 n^2+1\right )}-\frac {\cos \left (a+b \log \left (c x^n\right )\right )}{x \left (b^2 n^2+1\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*Log[c*x^n]]/x^2,x]

[Out]

-(Cos[a + b*Log[c*x^n]]/((1 + b^2*n^2)*x)) + (b*n*Sin[a + b*Log[c*x^n]])/((1 + b^2*n^2)*x)

Rule 4574

Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[(m + 1)*(e*x)^(m +
1)*(Cos[d*(a + b*Log[c*x^n])]/(b^2*d^2*e*n^2 + e*(m + 1)^2)), x] + Simp[b*d*n*(e*x)^(m + 1)*(Sin[d*(a + b*Log[
c*x^n])]/(b^2*d^2*e*n^2 + e*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b^2*d^2*n^2 + (m + 1)^2,
 0]

Rubi steps

\begin {align*} \int \frac {\cos \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx &=-\frac {\cos \left (a+b \log \left (c x^n\right )\right )}{\left (1+b^2 n^2\right ) x}+\frac {b n \sin \left (a+b \log \left (c x^n\right )\right )}{\left (1+b^2 n^2\right ) x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 41, normalized size = 0.73 \begin {gather*} \frac {-\cos \left (a+b \log \left (c x^n\right )\right )+b n \sin \left (a+b \log \left (c x^n\right )\right )}{x+b^2 n^2 x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*Log[c*x^n]]/x^2,x]

[Out]

(-Cos[a + b*Log[c*x^n]] + b*n*Sin[a + b*Log[c*x^n]])/(x + b^2*n^2*x)

________________________________________________________________________________________

Maple [F]
time = 0.01, size = 0, normalized size = 0.00 \[\int \frac {\cos \left (a +b \ln \left (c \,x^{n}\right )\right )}{x^{2}}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+b*ln(c*x^n))/x^2,x)

[Out]

int(cos(a+b*ln(c*x^n))/x^2,x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 208 vs. \(2 (56) = 112\).
time = 0.30, size = 208, normalized size = 3.71 \begin {gather*} \frac {{\left ({\left (b \cos \left (b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) - b \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + b \sin \left (b \log \left (c\right )\right )\right )} n - \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (b \log \left (c\right )\right ) - \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) - \cos \left (b \log \left (c\right )\right )\right )} \cos \left (b \log \left (x^{n}\right ) + a\right ) + {\left ({\left (b \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (b \log \left (c\right )\right ) + b \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + b \cos \left (b \log \left (c\right )\right )\right )} n + \cos \left (b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) - \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + \sin \left (b \log \left (c\right )\right )\right )} \sin \left (b \log \left (x^{n}\right ) + a\right )}{2 \, {\left ({\left (b^{2} \cos \left (b \log \left (c\right )\right )^{2} + b^{2} \sin \left (b \log \left (c\right )\right )^{2}\right )} n^{2} + \cos \left (b \log \left (c\right )\right )^{2} + \sin \left (b \log \left (c\right )\right )^{2}\right )} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b*log(c*x^n))/x^2,x, algorithm="maxima")

[Out]

1/2*(((b*cos(b*log(c))*sin(2*b*log(c)) - b*cos(2*b*log(c))*sin(b*log(c)) + b*sin(b*log(c)))*n - cos(2*b*log(c)
)*cos(b*log(c)) - sin(2*b*log(c))*sin(b*log(c)) - cos(b*log(c)))*cos(b*log(x^n) + a) + ((b*cos(2*b*log(c))*cos
(b*log(c)) + b*sin(2*b*log(c))*sin(b*log(c)) + b*cos(b*log(c)))*n + cos(b*log(c))*sin(2*b*log(c)) - cos(2*b*lo
g(c))*sin(b*log(c)) + sin(b*log(c)))*sin(b*log(x^n) + a))/(((b^2*cos(b*log(c))^2 + b^2*sin(b*log(c))^2)*n^2 +
cos(b*log(c))^2 + sin(b*log(c))^2)*x)

________________________________________________________________________________________

Fricas [A]
time = 4.62, size = 45, normalized size = 0.80 \begin {gather*} \frac {b n \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) - \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{{\left (b^{2} n^{2} + 1\right )} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b*log(c*x^n))/x^2,x, algorithm="fricas")

[Out]

(b*n*sin(b*n*log(x) + b*log(c) + a) - cos(b*n*log(x) + b*log(c) + a))/((b^2*n^2 + 1)*x)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 1.30, size = 190, normalized size = 3.39 \begin {gather*} \begin {cases} \frac {i \sin {\left (a - \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 x} + \frac {i \log {\left (c x^{n} \right )} \sin {\left (a - \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 n x} + \frac {\log {\left (c x^{n} \right )} \cos {\left (a - \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 n x} & \text {for}\: b = - \frac {i}{n} \\- \frac {\cos {\left (a + \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 x} - \frac {i \log {\left (c x^{n} \right )} \sin {\left (a + \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 n x} + \frac {\log {\left (c x^{n} \right )} \cos {\left (a + \frac {i \log {\left (c x^{n} \right )}}{n} \right )}}{2 n x} & \text {for}\: b = \frac {i}{n} \\\frac {b n \sin {\left (a + b \log {\left (c x^{n} \right )} \right )}}{b^{2} n^{2} x + x} - \frac {\cos {\left (a + b \log {\left (c x^{n} \right )} \right )}}{b^{2} n^{2} x + x} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b*ln(c*x**n))/x**2,x)

[Out]

Piecewise((I*sin(a - I*log(c*x**n)/n)/(2*x) + I*log(c*x**n)*sin(a - I*log(c*x**n)/n)/(2*n*x) + log(c*x**n)*cos
(a - I*log(c*x**n)/n)/(2*n*x), Eq(b, -I/n)), (-cos(a + I*log(c*x**n)/n)/(2*x) - I*log(c*x**n)*sin(a + I*log(c*
x**n)/n)/(2*n*x) + log(c*x**n)*cos(a + I*log(c*x**n)/n)/(2*n*x), Eq(b, I/n)), (b*n*sin(a + b*log(c*x**n))/(b**
2*n**2*x + x) - cos(a + b*log(c*x**n))/(b**2*n**2*x + x), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b*log(c*x^n))/x^2,x, algorithm="giac")

[Out]

integrate(cos(b*log(c*x^n) + a)/x^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\cos \left (a+b\,\ln \left (c\,x^n\right )\right )}{x^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*log(c*x^n))/x^2,x)

[Out]

int(cos(a + b*log(c*x^n))/x^2, x)

________________________________________________________________________________________